package com.wingyo.ui

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.LogUtils
import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions
import com.qupai.lib_base.app.BaseApplication
import com.wingyo.printer.R

class MainActivity : AppCompatActivity() {


    @SuppressLint("MissingInflatedId", "SdCardPath", "SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        manageExSD()
    }

    private fun manageExSD() {
//        requestPermissions(arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE),100)
        XXPermissions.with(this)
            .permission(Permission.MANAGE_EXTERNAL_STORAGE)
            .request(object : OnPermissionCallback {
                override fun onGranted(permissions: MutableList<String>, allGranted: Boolean) {
                    LogUtils.i("allGranted:$allGranted")
                    LogUtils.i("permissions:$permissions")
                }

                override fun onDenied(permissions: MutableList<String>, doNotAskAgain: Boolean) {
                    LogUtils.i("doNotAskAgain:$doNotAskAgain")
                }
            })
    }



}